<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 前段环境
        // 同步任务  异步任务
        // 执行栈
        const promise1=new Promise((resolve,reject)=>{  //  同步
            console.log('promise1')
            setTimeout(()=>{
                 resolve();
            },1000)  
        })
        // then 代码 放入event loop
        promise1
          .then(()=>{  //异步
             console.log('-----');
             console.log(promise1)  //fulfilled
          })
        console.log('1',promise1)  // 同步
     
    </script>
</body>
</html>